import requests

# 基础 URL
base_url = "http://106.53.102.240:6003/musicClip/startTask/ids?ids="

# 请求头
headers = {
    'User-Agent': 'Apifox/1.0.0 (https://apifox.com)'
}

# 循环 1 到 120
for task_id in range(1, 121):
    url = f"{base_url}{task_id}"  # 动态拼接 URL
    print(f"[INFO] 正在处理 ID: {task_id}, URL: {url}")  # 日志输出

    try:
        # 发送 GET 请求
        response = requests.get(url, headers=headers)

        # 检查响应状态码
        if response.status_code == 200:
            print(f"[SUCCESS] ID {task_id} 调用成功，响应: {response.text}")
        else:
            print(f"[ERROR] ID {task_id} 调用失败，状态码: {response.status_code}, 响应: {response.text}")

    except requests.exceptions.RequestException as e:
        print(f"[EXCEPTION] ID {task_id} 请求异常: {str(e)}")

print("[INFO] 所有任务执行完毕！")